//


import UIKit

class WP_WeekListTableViewCell: UITableViewCell {
    
    var dateLabel:UILabel!      //shijian
    var finishLabel:UILabel!    //完成
    var unfinishLabel:UILabel!  //未完成
    var reportLabel:UILabel!    //总结
    var planLabel:UILabel!      //计划
    var markLabel:UILabel!      //备注
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
       super.init(style: .default, reuseIdentifier: reuseIdentifier)
        
        setupView()
    }
    
    func setupView()  {
        
        dateLabel = UILabel(frame: CGRect(x: kRatioWidth(12), y: kRatioHeight(10), width: kRatioWidth(200), height: kRatioHeight(20)))
        dateLabel.textColor = UIColorFromHex(0xEE799F)
        dateLabel.font = FontPFRegular(16)
        dateLabel.text = "2019-22-33 21:09"
        self.contentView.addSubview(dateLabel)
        
        finishLabel = UILabel(frame: CGRect(x: kRatioWidth(12), y: dateLabel.frame.maxY+kRatioHeight(30), width: kScreenWidth-kRatioWidth(24), height: kRatioHeight(20)))
        finishLabel.textColor = UIColorFromHex(0x696969)
        finishLabel.font = FontPFRegular(16)
        finishLabel.text = "Work done：jsdjsdjlsdk;q louewl jwlspqie "
        self.contentView.addSubview(finishLabel)
        
        unfinishLabel = UILabel(frame: CGRect(x: kRatioWidth(12), y: finishLabel.frame.maxY+kRatioHeight(10), width: kScreenWidth-kRatioWidth(24), height: kRatioHeight(20)))
        unfinishLabel.textColor = UIColorFromHex(0x696969)
        unfinishLabel.font = FontPFRegular(16)
        unfinishLabel.text = "Unfinished business：jsdjsdjlsdk;q louewl jwlspqie "
        self.contentView.addSubview(unfinishLabel)
        
        reportLabel = UILabel(frame: CGRect(x: kRatioWidth(12), y: unfinishLabel.frame.maxY+kRatioHeight(10), width: kScreenWidth-kRatioWidth(24), height: kRatioHeight(20)))
        reportLabel.textColor = UIColorFromHex(0x696969)
        reportLabel.font = FontPFRegular(16)
        reportLabel.text = "Job summary：jsdjsdjlsdk;q louewl jwlspqie "
        self.contentView.addSubview(reportLabel)
        
        planLabel = UILabel(frame: CGRect(x: kRatioWidth(12), y: reportLabel.frame.maxY+kRatioHeight(10), width: kScreenWidth-kRatioWidth(24), height: kRatioHeight(20)))
        planLabel.textColor = UIColorFromHex(0x696969)
        planLabel.font = FontPFRegular(16)
        planLabel.text = "Work plan for next：jsdjsdjlsdk;q louewl jwlspqie "
        self.contentView.addSubview(planLabel)
        
        markLabel = UILabel(frame: CGRect(x: kRatioWidth(12), y: planLabel.frame.maxY+kRatioHeight(10), width: kScreenWidth-kRatioWidth(24), height: kRatioHeight(20)))
        markLabel.textColor = UIColorFromHex(0x696969)
        markLabel.font = FontPFRegular(16)
        markLabel.text = "Remarks：jsdjsdjlsdk;q louewl jwlspqie "
        self.contentView.addSubview(markLabel)
        
//        let label = UILabel.init(frame: CGRect(x: kRatioWidth(12), y: markLabel.frame.maxY+kRatioHeight(10), width: kScreenWidth-kRatioWidth(24), height: kRatioHeight(50)))
//        label.textColor = UIColor.red
//        label.font = FontPFRegular(15)
//        label.numberOfLines = 0
//        label.text = "jsdkd jsj : \n djsl djsle dja "
//        self.contentView.addSubview(label)
        
    }
    
    
    
    func setModel(date:String?,finish:String?,unfinish:String?,summary:String?,plan:String?,remark:String?) {
        
        dateLabel.text = date
        finishLabel.text = "Work done：\(finish ?? "")"
        unfinishLabel.text = "Unfinished business：\(unfinish ?? "")"
        reportLabel.text = "Job summary：\(summary ?? "")"
        markLabel.text = "Remarks：\(remark ?? "")"
        planLabel.text = "Work plan for next：\(plan ?? "")"
        
    }
    
    
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
